
[dbo].[OrderProductCategoryLookup]
CREATE TABLE [dbo].[OrderProductCategoryLookup]
(
[OrderProductID] [int] NOT NULL,
[OrderCategoryID] [int] NOT NULL,
[IsFeatured] [bit] NOT NULL,
[SortOrder] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderProductCategoryLookup] ADD CONSTRAINT [PK_OrderProductCategoryLookup] PRIMARY KEY CLUSTERED ([OrderProductID], [OrderCategoryID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderProductCategoryLookup] ADD CONSTRAINT [FK_OrderProductCategoryLookup_OrderCategory] FOREIGN KEY ([OrderCategoryID]) REFERENCES [dbo].[OrderCategory] ([OrderCategoryID]) ON DELETE CASCADE ON UPDATE CASCADE
GO
ALTER TABLE [dbo].[OrderProductCategoryLookup] ADD CONSTRAINT [FK_OrderProductCategoryLookup_OrderProduct] FOREIGN KEY ([OrderProductID]) REFERENCES [dbo].[OrderProduct] ([OrderProductID]) ON DELETE CASCADE ON UPDATE CASCADE
GO